#define DEBUG
#include <cstdio>
#include <cmath>

using namespace std;

const int maxm=20000000, mods=998244353;

void getPrime(int a, int *ans) {
  ans[0] = 0;
  for (int i=1, t=sqrt(a); i<=t; i++) {
    if (a%i==0) {
      ans[++ans[0]] = i;
      if (i*i!=a) {
	ans[++ans[0]] = a/i;
      }
    }
  }
}

long long qpower(long long a, int n) {
  if (n==0) {
    return 1;
  }
  long long s=1;
  for (; n>1; n/=2) {
    if (n%2) {
      s = s*a%mods;
    }
    a = a*a%mods;
  }
  return a*s%mods;
}

int gcd(int a, int b) {
  for (int r=a%b; r; a=b, b=r, r=a%b);
  return b;
}

long long solve(int o, int n, int prime[], int b) {
  if (o>n) {
    return b;
  } else {
    long long ret=0;
    for (int i=1; i<=prime[0]; i++) {
      ret = (ret+solve(o+1, n, prime, gcd(b, prime[i])))%mods;
    }
    return ret;
  }
}

long long f(int a, int b, int n) {
  static int prime[maxm+1];
  getPrime(a, prime);
  if (b==1) {
    return qpower(prime[0], n);
  } else {
    return solve(1, n, prime, b);
  }
}

int main() {
  freopen("sequence.in", "r", stdin);
  freopen("sequence.out", "w", stdout);

  int n, m, b;
  scanf("%d %d %d", &n, &m, &b);
  long long sum=0;
  for (int i=1; i<=m; i++) {
    sum = (sum+f(i, b, n))%mods;
  }
  printf("%lld", sum);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
